using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for TransportChargeDao
/// </summary>
public class TransportChargeDao
{
    public TransportChargeDao() { }

    public void Add(TransportCharge dto)
    {
        string proc = "sp_AddTransportCharge";
        SqlCommand cmd = DbProvider.CreateCommand(proc);

        cmd.Parameters.Add("@ProID", SqlDbType.Decimal);
        cmd.Parameters.Add("@ChargeID", SqlDbType.Decimal);
        cmd.Parameters.Add("@Fee", SqlDbType.Money);
        cmd.Parameters.Add("@Note", SqlDbType.NVarChar);
        cmd.Parameters.Add("@ID", SqlDbType.Decimal).Direction = ParameterDirection.Output;

        cmd.Parameters["@ProID"].Value = dto.ProID;
        cmd.Parameters["@ChargeID"].Value = dto.ChargeID;
        cmd.Parameters["@Fee"].Value = dto.Fee;
        cmd.Parameters["@Note"].Value = dto.Note;

        DbProvider.ExecCmd(cmd);
        dto.ID = (decimal)cmd.Parameters["@ID"].Value;
    }
}
